package cn.itsource.org.domain;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.List;

/**
 * 部门
 * alt选中多行
 * ctrl+方向右键 光标移到每行最后添加分号
 * ctrl+alt+l 格式化代码
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("部门")
public class Department {

    private Long id;
    //部门编号
    @ApiModelProperty("部门编号")
    @NotEmpty(message = "部门编号不可为空")
    private String sn;
    //部门名称
    @ApiModelProperty("部门名称")
    @NotEmpty(message = "部门名称不可为空")
    private String name;
    //上级分类id
    private String dirPath;
    //部门状态，0正常，1禁用
    @ApiModelProperty("部门状态，0正常，1禁用")
    private Integer state;
    //员工对象
    private Employee manager;
    //部门管理员id
    private Long manager_id;
    //上级部门
    private Department parent;
    //上级部门id
    private Long parent_id;

    //子级部门
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>();

}
